home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / f1ocx / vcform1.2 / VB4 / FORMAT1 / format1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-15  |  7.9 KB  |  260 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Cell Formatting Example"
  4.    ClientHeight    =   5310
  5.    ClientLeft      =   1200
  6.    ClientTop       =   1545
  7.    ClientWidth     =   7575
  8.    Height          =   5775
  9.    Icon            =   "format1.frx":0000
  10.    Left            =   1110
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   5310
  13.    ScaleWidth      =   7575
  14.    Top             =   1170
  15.    Width           =   7755
  16.    Begin VB.CommandButton cmdFormat 
  17.       Caption         =   "3D Effects 2"
  18.       Height          =   375
  19.       Index           =   15
  20.       Left            =   5940
  21.       TabIndex        =   17
  22.       Top             =   4020
  23.       Width           =   1215
  24.    End
  25.    Begin VB.CommandButton cmdFormat 
  26.       Caption         =   "3D Effects 1"
  27.       Height          =   375
  28.       Index           =   14
  29.       Left            =   5940
  30.       TabIndex        =   16
  31.       Top             =   3660
  32.       Width           =   1215
  33.    End
  34.    Begin VB.CommandButton cmdFormat 
  35.       Caption         =   "List 3"
  36.       Height          =   375
  37.       Index           =   13
  38.       Left            =   4560
  39.       TabIndex        =   15
  40.       Top             =   4380
  41.       Width           =   1215
  42.    End
  43.    Begin VB.CommandButton cmdFormat 
  44.       Caption         =   "List 2"
  45.       Height          =   375
  46.       Index           =   12
  47.       Left            =   4560
  48.       TabIndex        =   14
  49.       Top             =   4020
  50.       Width           =   1215
  51.    End
  52.    Begin VB.CommandButton cmdFormat 
  53.       Caption         =   "List 1"
  54.       Height          =   375
  55.       Index           =   11
  56.       Left            =   4560
  57.       TabIndex        =   13
  58.       Top             =   3660
  59.       Width           =   1215
  60.    End
  61.    Begin VB.CommandButton cmdFormat 
  62.       Caption         =   "Colorful 4"
  63.       Height          =   375
  64.       Index           =   10
  65.       Left            =   3180
  66.       TabIndex        =   12
  67.       Top             =   4740
  68.       Width           =   1215
  69.    End
  70.    Begin VB.CommandButton cmdFormat 
  71.       Caption         =   "Colorful 3"
  72.       Height          =   375
  73.       Index           =   9
  74.       Left            =   3180
  75.       TabIndex        =   11
  76.       Top             =   4380
  77.       Width           =   1215
  78.    End
  79.    Begin VB.CommandButton cmdFormat 
  80.       Caption         =   "Colorful 2"
  81.       Height          =   375
  82.       Index           =   8
  83.       Left            =   3180
  84.       TabIndex        =   10
  85.       Top             =   4020
  86.       Width           =   1215
  87.    End
  88.    Begin VB.CommandButton cmdFormat 
  89.       Caption         =   "Colorful 1"
  90.       Height          =   375
  91.       Index           =   7
  92.       Left            =   3180
  93.       TabIndex        =   9
  94.       Top             =   3660
  95.       Width           =   1215
  96.    End
  97.    Begin VB.CommandButton cmdFormat 
  98.       Caption         =   "Accounting 3"
  99.       Height          =   375
  100.       Index           =   6
  101.       Left            =   1800
  102.       TabIndex        =   8
  103.       Top             =   4380
  104.       Width           =   1215
  105.    End
  106.    Begin VB.CommandButton cmdFormat 
  107.       Caption         =   "Accounting 2"
  108.       Height          =   375
  109.       Index           =   5
  110.       Left            =   1800
  111.       TabIndex        =   7
  112.       Top             =   4020
  113.       Width           =   1215
  114.    End
  115.    Begin VB.CommandButton cmdFormat 
  116.       Caption         =   "Accounting 1"
  117.       Height          =   375
  118.       Index           =   4
  119.       Left            =   1800
  120.       TabIndex        =   6
  121.       Top             =   3660
  122.       Width           =   1215
  123.    End
  124.    Begin VB.CommandButton cmdFormat 
  125.       Caption         =   "Classic 3"
  126.       Height          =   375
  127.       Index           =   3
  128.       Left            =   420
  129.       TabIndex        =   5
  130.       Top             =   4740
  131.       Width           =   1215
  132.    End
  133.    Begin VB.CommandButton cmdFormat 
  134.       Caption         =   "Classic 2"
  135.       Height          =   375
  136.       Index           =   2
  137.       Left            =   420
  138.       TabIndex        =   4
  139.       Top             =   4380
  140.       Width           =   1215
  141.    End
  142.    Begin VB.CommandButton cmdFormat 
  143.       Caption         =   "Classic 1"
  144.       Height          =   375
  145.       Index           =   1
  146.       Left            =   420
  147.       TabIndex        =   3
  148.       Top             =   4020
  149.       Width           =   1215
  150.    End
  151.    Begin VB.CommandButton cmdFormat 
  152.       Caption         =   "Simple"
  153.       Height          =   375
  154.       Index           =   0
  155.       Left            =   420
  156.       TabIndex        =   2
  157.       Top             =   3660
  158.       Width           =   1215
  159.    End
  160.    Begin VB.Label Label1 
  161.       Caption         =   $"format1.frx":044A
  162.       BeginProperty Font 
  163.          name            =   "Arial"
  164.          charset         =   0
  165.          weight          =   400
  166.          size            =   9.75
  167.          underline       =   0   'False
  168.          italic          =   0   'False
  169.          strikethrough   =   0   'False
  170.       EndProperty
  171.       Height          =   735
  172.       Left            =   240
  173.       TabIndex        =   1
  174.       Top             =   60
  175.       Width           =   7035
  176.       WordWrap        =   -1  'True
  177.    End
  178.    Begin VCIF1Lib.F1Book F1Book1 
  179.       Height          =   2595
  180.       Left            =   120
  181.       TabIndex        =   0
  182.       Top             =   900
  183.       Width           =   7335
  184.       _version        =   65536
  185.       _extentx        =   12938
  186.       _extenty        =   4577
  187.       _stockprops     =   96
  188.       borderstyle     =   1
  189.       appname         =   ""
  190.       filename        =   "format1.frx":0524
  191.    End
  192. Attribute VB_Name = "Form1"
  193. Attribute VB_Creatable = False
  194. Attribute VB_Exposed = False
  195. Option Explicit
  196. Private Sub cmdFormat_Click(Index As Integer)
  197.    With F1Book1
  198.       '' To make this work with any selection you will want to enable
  199.       '' selections, scrollbars, and remove the following 2 lines.
  200.       '' Then this example will work with the active selection. You
  201.       '' should do some error checking to ensure the selection is
  202.       '' proper - contains all required Ranges according to the
  203.       '' Cell_Formatting Module instructions.
  204.       .SetSelection 2, 2, 8, 6
  205.       .BackColor = .PaletteEntry(2)
  206.       '' All functions below preserve the initial seleciton
  207.       Select Case Index
  208.          Case 0:     ' Simple
  209.             Call FormatCells(F1Book1, SIMPLE)
  210.             
  211.          Case 1:     ' Classic 1
  212.             Call FormatCells(F1Book1, CLASSIC1)
  213.             
  214.          Case 2:     ' Classic 2
  215.             Call FormatCells(F1Book1, CLASSIC2)
  216.          Case 3:     ' Classic 3
  217.             Call FormatCells(F1Book1, CLASSIC3)
  218.             
  219.          Case 4:
  220.             Call FormatCells(F1Book1, ACCOUNTING1)
  221.          
  222.          Case 5:
  223.             Call FormatCells(F1Book1, ACCOUNTING2)
  224.          
  225.          Case 6:
  226.             Call FormatCells(F1Book1, ACCOUNTING3)
  227.          
  228.          Case 7:    ' Colorful 1
  229.             Call FormatCells(F1Book1, COLORFUL1)
  230.             
  231.          Case 8:     ' Colorful 2
  232.             Call FormatCells(F1Book1, COLORFUL2)
  233.          
  234.          Case 9:    ' Colorful 3
  235.             Call FormatCells(F1Book1, COLORFUL3)
  236.          
  237.          Case 10:    ' Colorful 4
  238.             Call FormatCells(F1Book1, COLORFUL4)
  239.          
  240.          Case 11:    ' List 1
  241.             Call FormatCells(F1Book1, LIST1)
  242.          
  243.          Case 12:    ' List 2
  244.             Call FormatCells(F1Book1, LIST2)
  245.          
  246.          Case 13:    ' List 3
  247.             Call FormatCells(F1Book1, LIST3)
  248.             
  249.          Case 14:    ' 3D Effects 1
  250.             Call FormatCells(F1Book1, EFFECTS3D1)
  251.             
  252.          Case 15:    ' 3D Effects 2
  253.             Call FormatCells(F1Book1, EFFECTS3D2)
  254.       
  255.       End Select
  256.       
  257.    End With
  258.             
  259. End Sub
  260.